--除一线员工，及班子成员之外均可以上报
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,2,3,1)
go
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,3,3,1)
go
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,4,3,1)
go
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,5,3,1)
go
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,6,3,1)
go
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,8,3,1)
go
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,10,3,1)
go
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,11,3,1)
go
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,12,3,1)
go

--装置长及班子成员可以关闭
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,4,1,1)
go
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,5,1,1)
go
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,6,1,1)
go
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,8,1,1)
go
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,9,1,1)
go
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,13,1,1)
go
insert into role_auth(AUTH_TYPE,ROLE_ID,PROCESS_METHOD,HAS_RIGHT) values (10,14,1,1)
go

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[weak_month_report](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[YEAR] [smallint] NOT NULL,
	[MONTH] [tinyint] NOT NULL,
	[DEPARTMENT1_ID] [int] NULL,
	[EQUIP_ID] [int] NULL,
	[USER_ID] [int] NULL,
	[PROBLEM_ID] [int] NULL,
	[REPORT_TYPE] [tinyint] NOT NULL,
	[WEAK_REPORT] [varbinary](max) NOT NULL,
 CONSTRAINT [PK_weak_month_report] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[deleted_weak_month_report](
	[ID] [int] NOT NULL,
	[YEAR] [smallint] NOT NULL,
	[MONTH] [tinyint] NOT NULL,
	[DEPARTMENT1_ID] [int] NULL,
	[EQUIP_ID] [int] NULL,
	[USER_ID] [int] NULL,
	[PROBLEM_ID] [int] NULL,
	[REPORT_TYPE] [tinyint] NOT NULL,
	[WEAK_REPORT] [varbinary](max) NOT NULL,
 CONSTRAINT [PK_deleted_weak_month_report] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO
